/* 
  v-has 自定义指令, 用于隐藏用户没有的权限的按钮
 */

// 权限列表, 在实际开发中, 应根据用户信息请求
const btnRole = [
  "custom_column:edit"
]

const has = {
  install(app) {
    app.directive('has', {
      mounted(el, binding) {
        // console.log(el,binding)
        if(!btnRole.includes(binding.value)) {
          el.parentNode.removeChild(el)
        }
      }
    })
  }
}

export default has